﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ClassLibrary.Data;
using ClassLibrary.Entity;
using System.Data;

namespace ClassLibrary.DAO
{
    public class TblMenuHorizDAO
    {
         private DBService _db = null;
         public TblMenuHorizDAO(string ConnectionString)
         {
            _db = new DBService(ConnectionString);
         }

         //public TblMenuHoriz GetMenuHoriz()
         //{
         //    TblMenuHoriz MenuHoriz = null;
         //    try
         //    {
         //        DataTable dt = _db.ExeSP_DataTable("select * from TblMenuHoriz", false, CommandType.Text);
         //        foreach (DataRow dr in dt.Rows)
         //        {
         //            MenuHoriz.ID = Convert.ToInt32(dr["ID"]);
         //            MenuHoriz.MenuNameEn = dr["MenuNameEn"].ToString();
         //            MenuHoriz.MenuDescEn = dr["MenuDescEn"].ToString();
         //            MenuHoriz.NavigationUrl = dr["NavigationUrl"].ToString();
         //            MenuHoriz.Ordered = Convert.ToInt32(dr["Ordered"]);
         //            MenuHoriz.ParentsId = Convert.ToInt32(dr["ParentsId"]);
         //            MenuHoriz.AccountID = dr["AccountID"].ToString();
         //        }
         //    }
         //    catch (Exception ex)
         //    {
         //        throw ex;
         //    }
         //    return MenuHoriz;
         //}

         public DataTable GetMenuHoriz()
         {
             DataTable MenuHoriz = null;
             try
             {
                 MenuHoriz = _db.ExeSP_DataTable("select * from TblMenuHoriz", false, CommandType.Text);
             }
             catch (Exception ex)
             {
                 throw ex;
             }
             return MenuHoriz;
         }
    }
}
